package com.nontax.test.common.domain;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Builder
public class BaseResponse {

    private String code;
    private String msg;
    private Object data;

    public static BaseResponse error(String msg){
        return BaseResponse.builder().code("500").data(null).msg(msg).build();
    }

    public static BaseResponse ok (String msg,Object obj){
        return BaseResponse.builder().code("200").data(obj).msg(msg).build();
    }
    public static BaseResponse ok (String msg){
        return BaseResponse.builder().code("200").data(null).msg(msg).build();
    }
    public static BaseResponse ok (){
        return BaseResponse.builder().code("200").data(null).msg("success").build();
    }
}
